home *** CD-ROM | disk | FTP | other *** search
- import java.io.DataInputStream;
-
- class CResponse extends CIconObject {
- public static final int NEXT_TASK = 1;
- public static final int BRANCH_TO_TASK = 2;
- public static final int USE_TASK_VARIABLE = 16;
- public static final int DO_ACTIONS_ONLY = 32;
- public static final int MAX_TASK_TAGS = 10;
- public static final int PREV_TASK_TAG = -1;
- public static final int VARIABLE_TASK_TAG = -2;
- public static final int FIRST_TASK = -3;
- public static final int LAST_TASK = -4;
- public static final int EXIT_TASK = -5;
- public static final int PREV_COURSE = -6;
- public static final int log_as_na = 0;
- public static final int log_as_correct = 1;
- public static final int log_as_wrong = 2;
- int m_nFlags;
- int[] m_nTaskNo = new int[10];
- String m_strVariableString;
- CActionManager m_ActionManager;
- short m_cLogType;
-
- boolean LoadFromFile(DataInputStream var1) {
- this.m_nFlags = FileLoad.ReadCPlusInt(var1);
- this.m_cLogType = FileLoad.ReadCPlusByte(var1);
- int var2 = 0;
-
- do {
- this.m_nTaskNo[var2] = FileLoad.ReadCPlusInt(var1);
- ++var2;
- } while(var2 < 10);
-
- this.m_strVariableString = FileLoad.ReadCString(var1);
- this.m_ActionManager.LoadFromFile(var1);
- return super.LoadFromFile(var1);
- }
-
- int GetGotoTaskTag() {
- return this.m_nTaskNo[0];
- }
-
- CResponse() {
- super(7);
- this.m_ActionManager = new CActionManager();
- this.m_nFlags = 1;
- int var1 = 0;
-
- do {
- this.m_nTaskNo[var1] = 0;
- ++var1;
- } while(var1 < 10);
-
- this.m_nTaskNo[0] = 1;
- }
-
- CResponse(int var1) {
- super(7);
- this.m_ActionManager = new CActionManager();
- ((CIconObject)this).SetTypeID(var1);
- this.m_nFlags = 1;
- int var2 = 0;
-
- do {
- this.m_nTaskNo[var2] = 0;
- ++var2;
- } while(var2 < 10);
-
- this.m_nTaskNo[0] = 1;
- }
-
- CResponse(CResponse var1) {
- super(((CIconObject)var1).GetTypeID());
- }
-
- CResponseReturn DoResponse(int var1) {
- CResponseReturn var2 = new CResponseReturn();
- byte var3 = 1;
- var2.m_nRet = 1;
- var2.m_nNextTaskTag = var1;
- if (this.m_strVariableString != null && !this.m_strVariableString.equals("")) {
- Utils.SetVariables(this.m_strVariableString, false);
- }
-
- if ((this.GetResponseFlags() & 32) != 0 && this.m_ActionManager.GetIconList().size() > 0) {
- this.m_ActionManager.OnDoAction();
- Globals.thePresView.RenderAndDrawDirtyList();
- var2.m_nRet = 32;
- return var2;
- } else {
- if ((this.m_nFlags & 1) > 0) {
- var3 = 1;
- } else if ((this.m_nFlags & 2) > 0) {
- var2.m_nRet = 2;
- var3 = 2;
- var1 = this.GetGotoTaskTag();
- var2.m_nNextTaskTag = var1;
- if (var1 == 0) {
- var2.m_nRet = 1;
- return var2;
- }
-
- if (var1 == -1) {
- var3 = -1;
- } else if (var1 == -3) {
- var3 = -3;
- } else if (var1 == -4) {
- var3 = -4;
- } else if (var1 == -5) {
- var3 = -5;
- } else if (var1 == -2) {
- CVariable var4 = Utils.SearchAllVariables(CVariableTable.strDefVariables[12]);
- if (var4 != null) {
- if ((var2.m_nNextTaskTag = (int)var4.GetIntegerValue()) == 0) {
- var3 = 1;
- }
- } else {
- var3 = 1;
- }
- } else if (var1 == -6) {
- System.out.println("Branching to previous presentation is not supported in this version");
- var3 = -5;
- }
- }
-
- var2.m_nRet = var3;
- return var2;
- }
- }
-
- int GetResponseFlags() {
- return this.m_nFlags;
- }
-
- short GetLogType() {
- return this.m_cLogType;
- }
- }
-